<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue2.4.4.js"></script>
</head>

<body>
    <div id="app">
        <p>firstname: <input type="text" v-model="firstname"></p>
        <p>lastname: <input type="text" v-model="lastname"></p>
        <p>fullname: <span>{{fullname}}</span></p>
    </div>

    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                firstname: '',
                lastname: ''
            },
            methods: {
            },
            computed: {
                fullname: function() {
                    return this.firstname + ' - ' + this.lastname
                }
            }
        });
    </script>
</body>

</html>